package cn.bytepath.product.domain;

import cn.bytepath.base.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 产品实体类
 * @author Jack.C
 * @version 1.0
 * @createDate 2022-01-24
 */
@Data
public class Product extends BaseDomain {

    private String name;
    private String resources;
    private BigDecimal saleprice;
    private Date offsaletime = new Date();
    private Date onsaletime = new Date();
    private Long state;
    private String costprice;
    private Date createtime = new Date();
    private Long salecount;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public Date getOffsaletime() {
        return offsaletime;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public void setOffsaletime(Date offsaletime) {
        this.offsaletime = offsaletime;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public Date getOnsaletime() {
        return onsaletime;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public void setOnsaletime(Date onsaletime) {
        this.onsaletime = onsaletime;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public Date getCreatetime() {
        return createtime;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }
}
